﻿using System;
using System.Collections.Generic;
using System.Text;

namespace JDML.MappingClass
{
    public class BaseMapping
    {
        public List<FieldMapping> DBFields { get; set; }
        public FieldMapping PrimaryKeyField
        {
            get
            {
                if (DBFields.Count > 0)
                {
                    if (DBFields[0].IsMapping && DBFields[0].DBPrimaryKey)
                    {
                        return DBFields[0];
                    }
                }
                return null;
            }
        }
        public FieldMapping AutoGeneratePrimaryKeyField
        {
            get
            {
                if (DBFields.Count > 0)
                {
                    if (DBFields[0].IsMapping && DBFields[0].DBPrimaryKey && DBFields[0].DBAutoGenerate)
                    {
                        return DBFields[0];
                    }
                }
                return null;
            }
        }
    }
}
